package com.caijin.web.controller.system.menu;


import com.caijin.common.core.domain.Result;
import com.caijin.common.util.ListToTree;
import com.caijin.system.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 院系专业表 前端控制器
 * </p>
 *
 * @author Peas
 * @since 2021-01-13
 */
@RestController
@RequestMapping("/system/department")
@CrossOrigin
public class DepartmentController {

    @Autowired
    private IDepartmentService iDepartmentService;

    @RequestMapping(path = "/getList",method = RequestMethod.GET)
    public Result getList(){
        return ListToTree.departmentToTree(iDepartmentService.list());
    }

}

